Periodicity
Periodicity vs Gender
We want to identify if there are a relation between the periodicity
of a smartwatch and the user’s gender
periodicity_gender <- swu %>%
group_by(gender, periodicity) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(periodicity)
# Chart
ggplot(periodicity_gender, aes(x = factor(gender), y = perc*100, fill = factor(periodicity))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Gender", y = "Percent", fill = "periodicity", title = "Percentage distribution of Periodicity per Gender") +
theme_minimal(base_size = 14) +
geom_text(data = periodicity_gender, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title="Periodicity"))

# Chart
ggplot(data = periodicity_gender) +
geom_bar(
aes(x = gender, y = perc, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = perc, label = ratio, group = periodicity),
position = position_dodge(width = 1),
vjust = -0.5, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Gender", y = "Percentage", title = "Distribution of Periodicity per Gender (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = periodicity_gender) +
geom_bar(
aes(x = gender, y = count, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = count, label = count, group = periodicity),
position = position_dodge(width = 1),
vjust = -0.5, size = 3
) +
labs(x = "Gender", y = "Count", title = "Distribution of Periodicity per Gender (Count)", subtitle = "Grouped bars version") +
theme_bw()

Periodicity vs Age
We want to identify if there are a relation between the periodicity
of a smartwatch and the user’s age
periodicity_age <- swu %>%
group_by(age, periodicity) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(periodicity)
# Chart
ggplot(periodicity_age, aes(x = factor(age), y = perc*100, fill = factor(periodicity))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Age", y = "Percent", fill = "periodicity", title = "Percentage distribution of Periodicity per Age") +
theme_minimal(base_size = 14) +
geom_text(data = periodicity_age, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title="Periodicity"))

# Chart
ggplot(data = periodicity_age) +
geom_bar(
aes(x = age, y = perc, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = perc, label = ratio, group = periodicity),
position = position_dodge(width = 1),
vjust = -0.5, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Age", y = "Percentage", title = "Distribution of Periodicity per Age (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = periodicity_age) +
geom_bar(
aes(x = age, y = count, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = count, label = count, group = periodicity),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Age", y = "Count", title = "Distribution of Periodicity per Age (Count)", subtitle = "Grouped bars version") +
theme_bw()

Periodicity vs Location
We want to identify if there are a relation between the periodicity
of a smartwatch and the user’s location
periodicity_location <- swu %>%
group_by(location, periodicity) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(periodicity)
# Chart
ggplot(periodicity_location, aes(x = factor(location), y = perc*100, fill = factor(periodicity))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Location", y = "Percent", fill = "periodicity", title = "Percentage distribution of Periodicity per Location") +
theme_minimal(base_size = 14) +
geom_text(data = periodicity_location, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title="Periodicity")) +
theme(axis.text.x = element_text(angle = 45))

# Chart
ggplot(data = periodicity_location) +
geom_bar(
aes(x = location, y = perc, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = perc, label = ratio, group = periodicity),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Location", y = "Percentage", title = "Distribution of Periodicity per Location (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = periodicity_location) +
geom_bar(
aes(x = location, y = count, fill = periodicity, group = periodicity),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = count, label = count, group = periodicity),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Location", y = "Count", title = "Distribution of Periodicity per Location (Count)", subtitle = "Grouped bars version") +
theme_bw()

Brand vs Gender
We want to identify if there are a relation between the brand of a
smartwatch and the user’s gender
brand_gender <- swu %>%
group_by(gender, brand) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(brand)
# Chart
ggplot(brand_gender, aes(x = factor(gender), y = perc * 100, fill = factor(brand))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Gender", y = "Percent", fill = "brand", title = "Percentage distribution of Brand per Gender") +
theme_minimal(base_size = 14) +
geom_text(data = brand_gender, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title="Brand"))

# Chart
ggplot(data = brand_gender) +
geom_bar(
aes(x = gender, y = perc, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = perc, label = ratio, group = brand),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Gender", y = "Percentage", title = "Distribution of Brand per gender (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = brand_gender) +
geom_bar(
aes(x = gender, y = count, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = count, label = count, group = brand),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Gender", y = "Count", title = "Distribution of Brand per Gender (Count)", subtitle = "Grouped bars version") +
theme_bw()

Brand vs Age
We want to identify if there are a relation between the brand of a
smartwatch and the user’s age
brand_age <- swu %>%
group_by(age, brand) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(brand)
# Chart
ggplot(brand_age, aes(x = factor(age), y = perc * 100, fill = factor(brand))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Age", y = "Percent", fill = "brand", title = "Percentage distribution of Brand per Age") +
theme_minimal(base_size = 14) +
geom_text(data = brand_age, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Brand"))

# Chart
ggplot(data = brand_age) +
geom_bar(
aes(x = age, y = perc, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = perc, label = ratio, group = brand),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Age", y = "Percentage", title = "Distribution of Brand per Age (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = brand_age) +
geom_bar(
aes(x = age, y = count, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = count, label = count, group = brand),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Age", y = "Count", title = "Distribution of Brand per Age (Count)", subtitle = "Grouped bars version") +
theme_bw()

Brand vs Location
We want to identify if there are a relation between the brand of a
smartwatch and the user’s location
brand_location <- swu %>%
group_by(location, brand) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(brand)
# Chart
ggplot(brand_location, aes(x = factor(location), y = perc * 100, fill = factor(brand))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Location", y = "Percent", fill = "brand", title = "Percentage distribution of Brand per Location") +
theme_minimal(base_size = 14) +
geom_text(data = brand_location, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Brand"))

# Chart
ggplot(data = brand_location) +
geom_bar(
aes(x = location, y = perc, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = perc, label = ratio, group = brand),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Location", y = "Percentage", title = "Distribution of Brand per Location (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = brand_location) +
geom_bar(
aes(x = location, y = count, fill = brand, group = brand),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = count, label = count, group = brand),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Location", y = "Count", title = "Distribution of Brand per Location (Count)", subtitle = "Grouped bars version") +
theme_bw()

Usage
Usage vs Gender
We want to identify if there are a relation between the usage of a
smartwatch and the user’s gender
gender_usage <- swu %>%
group_by(gender, usage) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(usage)
# Chart
ggplot(gender_usage, aes(x = factor(gender), y = perc * 100, fill = factor(usage))) +
geom_bar(stat ="identity", width = 0.7, position = "fill") +
labs(x = "Gender", y = "Percent", fill = "usage", title = "Percentage distribution of Usage per Gender") +
theme_minimal(base_size = 14) +
geom_text(data = gender_usage, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title="Usage"))

# Chart
ggplot(data = gender_usage) +
geom_bar(
aes(x = gender, y = perc, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = perc, label = ratio, group = usage),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Gender", y = "Percentage", title = "Distribution of Usage per Gender (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = gender_usage) +
geom_bar(
aes(x = gender, y = count, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = count, label = count, group = usage),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Gender", y = "Count", title = "Distribution of Usage per Gender (Count)", subtitle = "Grouped bars version") +
theme_bw()

Usage vs Age
We want to identify if there are a relation between the usage of a
smartwatch and the user’s age
age_usage <- swu %>%
group_by(age, usage) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(usage)
# Chart
ggplot(age_usage, aes(x = factor(age), y = perc * 100, fill = factor(usage))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Age", y = "Percent", fill = "usage", title = "Percentage distribution of Usage per Age") +
theme_minimal(base_size = 14) +
geom_text(data = age_usage, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Usage")) +
theme(axis.text.x = element_text(angle = 45))

# Chart
ggplot(data = age_usage) +
geom_bar(
aes(x = age, y = perc, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = perc, label = ratio, group = usage),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Age", y = "Percentage", title = "Distribution of Usage per Age (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = age_usage) +
geom_bar(
aes(x = age, y = count, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = count, label = count, group = usage),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Age", y = "Count", title = "Distribution of Usage per Age (Count)", subtitle = "Grouped bars version") +
theme_bw()

Usage vs Location
We want to identify if there are a relation between the usage of a
smartwatch and the user’s location
location_usage <- swu %>%
group_by(location, usage) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(usage)
# Chart
ggplot(location_usage, aes(x = factor(location), y = perc * 100, fill = factor(usage))) +
geom_bar(stat="identity", width = 0.7, position = "fill") +
labs(x = "Location", y = "Percent", fill = "usage", title = "Percentage distribution of Usage per Location") +
theme_minimal(base_size = 14) +
geom_text(data = location_usage, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill=guide_legend(title = "Usage")) +
theme(axis.text.x = element_text(angle = 45))

# Chart
ggplot(data = location_usage) +
geom_bar(
aes(x = location, y = perc, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = perc, label = ratio, group = usage),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Location", y = "Percentage", title = "Distribution of Usage per Location (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = location_usage) +
geom_bar(
aes(x = location, y = count, fill = usage, group = usage),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = count, label = count, group = usage),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Location", y = "Count", title = "Distribution of Usage per Location (Count)", subtitle = "Grouped bars version") +
theme_bw()

Features
Features vs Gender
We want to identify if there are a relation between the used features
of a smartwatch and the user’s gender.
gender_features <- features_grouped_rows %>%
group_by(gender, features_grouped) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(features_grouped)
# Chart
ggplot(gender_features, aes(x = factor(gender), y = perc * 100, fill = factor(features_grouped))) +
geom_bar(stat = "identity", width = 0.7, position = "fill") +
labs(x = "Gender", y = "Percent", fill = "features_grouped", title = "Percentage distribution of Features per Gender") +
theme_minimal(base_size = 14) +
geom_text(data = gender_features, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Features"))

# Chart
ggplot(data = gender_features) +
geom_bar(
aes(x = gender, y = perc, fill = features_grouped, group = features_grouped),
stat = 'identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = perc, label = ratio, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Gender", y = "Percentage", title = "Distribution of Features per Gender (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = gender_features) +
geom_bar(
aes(x = gender, y = count, fill = features_grouped, group = features_grouped),
stat='identity', position = 'dodge'
) +
facet_wrap(~ gender, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = gender, y = count, label = count, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Gender", y = "Count", title = "Distribution of Features per Gender (Count)", subtitle = "Grouped bars version") +
theme_bw()

Features vs Age
We want to identify if there are a relation between the used features
of a smartwatch and the user’s age.
age_features <- features_grouped_rows %>%
group_by(age, features_grouped) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(features_grouped)
# Chart
ggplot(age_features, aes(x = factor(age), y = perc * 100, fill = factor(features_grouped))) +
geom_bar(stat = "identity", width = 0.7, position = "fill") +
labs(x = "Age", y = "Percent", fill = "features_grouped", title = "Percentage distribution of Features per Age") +
theme_minimal(base_size = 14) +
geom_text(data = age_features, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Features")) +
theme(axis.text.x = element_text(angle = 45))

# Chart
ggplot(data = age_features) +
geom_bar(
aes(x = age, y = perc, fill = features_grouped, group = features_grouped),
stat = 'identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = perc, label = ratio, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Age", y = "Percentage", title = "Distribution of Features per Age (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = age_features) +
geom_bar(
aes(x = age, y = count, fill = features_grouped, group = features_grouped),
stat='identity', position = 'dodge'
) +
facet_wrap(~ age, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = age, y = count, label = count, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Age", y = "Count", title = "Distribution of Features per Age (Count)", subtitle = "Grouped bars version") +
theme_bw()

Features vs Location
We want to identify if there are a relation between the features of a
smartwatch and the user’s location
location_features <- features_grouped_rows %>%
group_by(location, features_grouped) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(round(perc, 2))) %>%
drop_na(features_grouped)
# Chart
ggplot(location_features, aes(x = factor(location), y = perc * 100, fill = factor(features_grouped))) +
geom_bar(stat = "identity", width = 0.7, position = "fill") +
labs(x = "Location", y = "Percent", fill = "features_grouped", title = "Percentage distribution of Features per Location") +
theme_minimal(base_size = 14) +
geom_text(data = location_features, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill = guide_legend(title = "Features")) +
theme(axis.text.x = element_text(angle = 45))

# Chart
ggplot(data = location_features) +
geom_bar(
aes(x = location, y = perc, fill = features_grouped, group = features_grouped),
stat = 'identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = perc, label = ratio, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0, size = 3
) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
labs(x = "Location", y = "Percentage", title = "Distribution of Features per Location (%)", subtitle = "Grouped bars version") +
theme_bw()

ggplot(data = location_features) +
geom_bar(
aes(x = location, y = count, fill = features_grouped, group = features_grouped),
stat='identity', position = 'dodge'
) +
facet_wrap(~ location, scales = "free_x", drop = TRUE) +
geom_text(
aes(x = location, y = count, label = count, group = features_grouped),
position = position_dodge(width = 1),
vjust = 0.1, size = 3
) +
labs(x = "Location", y = "Count", title = "Distribution of Features per Location (Count)", subtitle = "Grouped bars version") +
theme_bw()

Functionalities
Functionalities vs Gender
We want to identify if there are a relation between the
functionalities of a smartwatch and the user’s gender.
gender_functionalities <- functionalities_grouped_rows %>%
group_by(gender, functionalities) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(count/sum(count))) %>%
drop_na(functionalities)
# Chart
ggplot(gender_functionalities, aes(x = factor(gender), y = perc*100, fill = factor(functionalities))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Gender", y = "Percent", fill = "functionalities", title = "Percentage distribution of 'Functionalities' per Gender") +
theme_minimal(base_size = 14) +
geom_text(data = gender_functionalities, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill=guide_legend(title="Functionalities"))
# Grouped
ggplot(data = gender_functionalities, aes(fill = functionalities, y = count, x = gender)) +
geom_bar(position="dodge", stat="identity") +
labs(x = "Gender", y = "Count", title = "Distribution of Functionalities per Gender", subtitle = "Functionalities grouped by Gender") +
guides(fill=guide_legend(title="Gender"))
# Grouped
ggplot(data = gender_functionalities, aes(fill = functionalities, y = perc * 100, x = gender)) +
geom_bar(position="dodge", stat="identity", ) +
labs(x = "Gender", y = "Percentage", title = "Percentage distribution of Functionalities per Gender", subtitle = "Functionalities grouped by gender") +
guides(fill = guide_legend(title = "Functionalities"))
Functionalities vs Age
We want to identify if there are a relation between the tracked
functionalities of a smartwatch per age.
age_functionalities <- functionalities_grouped_rows %>%
group_by(age, functionalities) %>%
summarise(count = n()) %>%
mutate(perc = count/sum(count), ratio = scales::percent(count/sum(count))) %>%
drop_na(functionalities)
# Chart
ggplot(age_functionalities, aes(x = factor(age), y = perc*100, fill = factor(functionalities))) +
geom_bar(stat="identity", width = 0.7, position="fill") +
labs(x = "Age", y = "Percent", fill = "functionalities", title = "Percentage distribution of 'Functionalities' per Age") +
theme_minimal(base_size = 14) +
geom_text(data = age_functionalities, aes(y = count, label = ratio), position = position_fill(vjust = 0.5)) +
scale_y_continuous(labels = scales::percent_format(accuracy = 5L)) +
guides(fill=guide_legend(title="Functionalities")) +
theme(axis.text.x = element_text(angle = 45))
# Grouped
ggplot(data = gender_functionalities, aes(fill = functionalities, y = count, x = gender)) +
geom_bar(position="dodge", stat="identity") +
labs(x = "Gender", y = "Count", title = "Distribution of Functionalities per Gender", subtitle = "Functionalities grouped by Gender") +
guides(fill=guide_legend(title="Gender"))